<!DOCTYPE html>
<html>
<head>
<title>后台管理 - 登陆</title>
<meta http-equiv="content-Type" content="text/html; charset=utf-8">
<meta http-equiv="pragma" content="no-cache"> 
<meta http-equiv="Cache-Control" content="no-store, must-revalidate"> 
<meta http-equiv="expires" content="0">
<meta name="viewport" content="initial-scale=1.0,user-scalable=no,maximum-scale=1,width=device-width">
<style>
	*{padding:0;margin:0;}
	html, body{ height: 100%;}
	a{text-decoration: none;}
	a:hover{text-decoration: underline;}
	body{
	    overflow: hidden;
	    font: 13px 'Lucida Sans Unicode', 'Trebuchet MS', Arial, Helvetica;    
	}
	#divLoginBg{
		position: absolute;
		z-index: 0;
		width: 100%;
		height: 100%;
		background-color: #ddd;
		background-size: 13px 13px, 29px 29px, 37px 37px, 53px 53px;
		background-image: -webkit-linear-gradient(0, rgba(255, 255, 255, .07) 50%, transparent 50%), 
			-webkit-linear-gradient(0, rgba(255, 255, 255, .13) 50%, transparent 50%), 
			-webkit-linear-gradient(0, transparent 50%, rgba(255, 255, 255, .17) 50%),
			-webkit-linear-gradient(0, transparent 50%, rgba(255, 255, 255, .19) 50%);
		background-image: -moz-linear-gradient(0, rgba(255, 255, 255, .07) 50%, transparent 50%),
			-moz-linear-gradient(0, rgba(255, 255, 255, .13) 50%, transparent 50%), 
			-moz-linear-gradient(0, transparent 50%, rgba(255, 255, 255, .17) 50%),
			-moz-linear-gradient(0, transparent 50%, rgba(255, 255, 255, .19) 50%);
	}
	/*--------------------*/
	#divLogin{
	    background-color: #fff;
	    background-image: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#eee));
	    background-image: -webkit-linear-gradient(top, #fff, #eee);
	    background-image: -moz-linear-gradient(top, #fff, #eee);
	    background-image: linear-gradient(top, #fff, #eee);  
	    height: 240px;
	    width: 300px;
	    margin: -150px 0 0 -180px;
	    padding: 30px;
	    position: absolute;
	    top: 50%;
	    left: 50%;
	    z-index: 0;
	    -moz-border-radius: 3px;
	    -webkit-border-radius: 3px;
	    border-radius: 3px;  
	    -webkit-box-shadow:
	          0 0 2px rgba(0, 0, 0, 0.2),
	          0 1px 1px rgba(0, 0, 0, .2),
	          0 3px 0 #fff,
	          0 4px 0 rgba(0, 0, 0, .2),
	          0 6px 0 #fff,  
	          0 7px 0 rgba(0, 0, 0, .2);
	    -moz-box-shadow:
	          0 0 2px rgba(0, 0, 0, 0.2),  
	          1px 1px   0 rgba(0,   0,   0,   .1),
	          3px 3px   0 rgba(255, 255, 255, 1),
	          4px 4px   0 rgba(0,   0,   0,   .1),
	          6px 6px   0 rgba(255, 255, 255, 1),  
	          7px 7px   0 rgba(0,   0,   0,   .1);
	    box-shadow:
	          0 0 2px rgba(0, 0, 0, 0.2),  
	          0 1px 1px rgba(0, 0, 0, .2),
	          0 3px 0 #fff,
	          0 4px 0 rgba(0, 0, 0, .2),
	          0 6px 0 #fff,  
	          0 7px 0 rgba(0, 0, 0, .2);
	}
	#divLogin:before{
	    content: '';
	    position: absolute;
	    z-index: -1;
	    border: 1px dashed #ccc;
	    top: 5px;
	    bottom: 5px;
	    left: 5px;
	    right: 5px;
	    -moz-box-shadow: 0 0 0 1px #fff;
	    -webkit-box-shadow: 0 0 0 1px #fff;
	    box-shadow: 0 0 0 1px #fff;
	}
	/*--------------------*/
	h1{
	    //text-shadow: 0 1px 0 rgba(255, 255, 255, .7), 0px 2px 0 rgba(0, 0, 0, .5);
	    text-transform: uppercase;
	    text-align: center;
	    color: #666;
	    margin: 0 0 30px 0;
	    letter-spacing: 4px;
	    font:  bold 26px/1 Verdana, Helvetica;
	    position: relative;
	}
	h1:after, h1:before{
	    background-color: #777;
	    content: "";
	    height: 1px;
	    position: absolute;
	    top: 15px;
	    width: 80px;   
	}
	h1:after{ 
	    background-image: -webkit-gradient(linear, left top, right top, from(#777), to(#fff));
	    background-image: -webkit-linear-gradient(left, #777, #fff);
	    background-image: -moz-linear-gradient(left, #777, #fff);
	    background-image: linear-gradient(left, #777, #fff);      
	    right: 0;
	}
	h1:before{
	    background-image: -webkit-gradient(linear, right top, left top, from(#777), to(#fff));
	    background-image: -webkit-linear-gradient(right, #777, #fff);
	    background-image: -moz-linear-gradient(right, #777, #fff);
	    background-image: linear-gradient(right, #777, #fff);
	    left: 0;
	}
	/*--------------------*/
	fieldset{border: 0;}
	/*--------------------*/
	#inputs input{
	    background: #f1f1f1 url(../images/login-sprite.png) no-repeat;
	    padding: 15px 15px 15px 30px;
	    margin: 0 0 10px 0;
	    width: 253px; /* 353 + 2 + 45 = 400 */
	    border: 1px solid #ccc;
	    -moz-border-radius: 5px;
	    -webkit-border-radius: 5px;
	    border-radius: 5px;
	    -moz-box-shadow: 0 1px 1px #ccc inset, 0 1px 0 #fff;
	    -webkit-box-shadow: 0 1px 1px #ccc inset, 0 1px 0 #fff;
	    box-shadow: 0 1px 1px #ccc inset, 0 1px 0 #fff;
	}
	#txtUserName{
	    background-position: 5px -2px !important;
	    font-size: 16px;
	}
	#txtPassword{
	    background-position: 5px -52px !important;
	    font-size: 16px;
	}
	#inputs input:focus{
	    background-color: #fff;
	    border-color: #e8c291;
	    outline: none;
	    -moz-box-shadow: 0 0 0 1px #e8c291 inset;
	    -webkit-box-shadow: 0 0 0 1px #e8c291 inset;
	    box-shadow: 0 0 0 1px #e8c291 inset;
	}
	/*--------------------*/
	#actions{margin: 25px 0 0 0;}
	#btnLoginSubmit{		
	    background-color: #ffb94b;
	    background-image: -webkit-gradient(linear, left top, left bottom, from(#fddb6f), to(#ffb94b));
	    background-image: -webkit-linear-gradient(top, #fddb6f, #ffb94b);
	    background-image: -moz-linear-gradient(top, #fddb6f, #ffb94b);
	    background-image: linear-gradient(top, #fddb6f, #ffb94b);
	    
	    -moz-border-radius: 3px;
	    -webkit-border-radius: 3px;
	    border-radius: 3px;
	    
	    text-shadow: 0 1px 0 rgba(255,255,255,0.5);
	    
	    -moz-box-shadow: 0 0 1px rgba(0, 0, 0, 0.3), 0 1px 0 rgba(255, 255, 255, 0.3) inset;
	    -webkit-box-shadow: 0 0 1px rgba(0, 0, 0, 0.3), 0 1px 0 rgba(255, 255, 255, 0.3) inset;
	    box-shadow: 0 0 1px rgba(0, 0, 0, 0.3), 0 1px 0 rgba(255, 255, 255, 0.3) inset;    
	    
	    border-width: 1px;
	    border-style: solid;
	    border-color: #d69e31 #e3a037 #d5982d #e3a037;
	
	    float: left;
	    height: 35px;
	    padding: 0;
	    width: 120px;
	    cursor: pointer;
	    font: bold 15px Arial, Helvetica;
	    color: #8f5a0a;
	}
	#btnLoginSubmit:hover,#btnLoginSubmit:focus{		
	    background-color: #fddb6f;
	    background-image: -webkit-gradient(linear, left top, left bottom, from(#ffb94b), to(#fddb6f));
	    background-image: -webkit-linear-gradient(top, #ffb94b, #fddb6f);
	    background-image: -moz-linear-gradient(top, #ffb94b, #fddb6f);
	    background-image: linear-gradient(top, #ffb94b, #fddb6f);
	}	
	#btnLoginSubmit:active{
		outline: none;
		-moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5) inset;
		-webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5) inset;
		box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5) inset;		
	}
	#btnLoginSubmit::-moz-focus-inner{ border: none; }
	#actions a{
	    color: #3151A2;    
	    float: right;
	    line-height: 35px;
	    margin-left: 20px;
	}
	/*--------------------*/
	#about{
	    display: block;
	    text-align: center;
	    position: relative;
	    top: 60px;
	    color: #999;
	}
</style>

<script type="text/javascript" src="../lib/js/zepto/zepto.min.js"></script>
<link type="text/css" rel="stylesheet" href="../lib/js/zepto/zepto.ux.css">
<script type="text/javascript" src="../lib/js/zepto/zepto.ux.js"></script>
<script type="text/javascript" src="../lib/js/md5.js"></script>
<script type="text/javascript">
function login(){
	var name = $('#txtUserName');
	var pwd = $('#txtPassword');
	/* 
	$.msg.show({
		title:name.val(),
		msg:'pwd:  '+pwd.val()
	});
	return;
	*/
	var msg = '';
	if(!/^[a-zA-Z][a-zA-Z0-9]{2,16}$/.test(name.val().trim()))
		msg += '请输入4~16位, 由数字和字母组成, 且手写为字母的用户名.';
	if(!/^[a-zA-Z0-9]{4,16}$/.test(pwd.val().trim())){
		if(!msg.isEmpty())
			msg += '<br>'
		msg += '请输入4~16位, 由数字和字母组成密码.';
	}
	if(!msg.isEmpty()){
		$.tip.show({ msg: msg});
		return;
	}
	$.LM.show();
	$.ajax({
		url : '../admin/AdminLogin.action',
		type : 'post',
		data : {
			'staff.rid' : 26,
			'staff.name' : name.val(),
			'staff.pwd' : MD5(pwd.val())
		},
		success : function(data, xhr, status){
			data = JSON.parse(data);
			//alert(data.success)
			if(data.success){
				window.location.href = "./index.htm"
			}else{
				$.LM.hide();
				$.tip.show(data);
			}
		},
		error : function(){
			$.LM.hide();
			alert('error')
		}
	});
}
</script>
</head>
<body>

<div id="divLoginBg"></div>
<div id="divLogin">
    <h1>管理后台</h1>
    <fieldset id="inputs">
        <input id="txtUserName" type="text" value="admin" placeholder="请输入用户名" autofocus required>   
        <input id="txtPassword" type="password" value="admin" placeholder="请输入密码" required>
    </fieldset>
    <fieldset id="actions">
        <input id="btnLoginSubmit" type="button" value="登陆" onClick="login()">
        <a href="">忘 记 密 码</a><a href="">注 册</a>
    </fieldset>
    <a href="" id="about">关于我们</a>
</div>

</body>
</html>
